1. Field of the Invention
The present invention relates to a graphic arrangement device capable of arranging input graphics. More particularly, it relates to a line symmetrical graphics arrangement device capable of arranging input graphics into line symmetrical figures with respect to a symmetry axis.
2. Description of the Related Art
The conventional graphic arrangement devices for arranging input graphics includes, by way of example, "A Device for Calculating Vertices of a Regular Polygon" disclosed in Japanese Patent Laid-Open No. 3-103992, "A Graphic Processor Having a Function of Creating a Regular Polygon" disclosed in Japanese Patent Laid-Open No. 63-24460, "A Method of Recognizing Symmetry of Graphics in a Graphic Recognizing Device" disclosed in Japanese Patent Laid-Open No. 63-261481, and the like.
The device disclosed in Japanese Patent Laid-Open No. 3-103992, "A Device for Calculating Vertices of a Regular Polygon", as a first example of the conventional arts, is used in order to calculate coordinates of vertices of a regular polygon.
FIG. 13 is a block diagram showing a constitution of a graphic arrangement device according to the first conventional art disclosed in the same. With reference to FIG. 13, the graphic arrangement device according to the first conventional art comprises a data input unit 111, a coordinate value computing unit 112, a sign reversing unit 133 and a data output unit 114.
FIG. 14 is a flow chart for use of describing a flow of processing in the graphic arrangement device indicated in FIG. 13. FIG. 15 is a view showing a range of vertices of a regular polygon, which vertices are calculated by the coordinate value computing unit 112 of the graphic arrangement device of FIG. 13. An operation on the graphic arrangement device will be, hereinafter, described referring to FIGS. 13 to 15.
The data input unit 111 judges whether the number of angles N is odd or even (Step 1402) when receiving a radius r of a circumscribed circle, coordinates (x, y) of a center, the number of angles N (also referred to as "the number of vertices") (Step 1401).
When the number of angles N is even, the coordinate value computing unit 112 calculates the values of the coordinates of a vertex existing in the first quadrant, as indicated in FIG. 15(A) (Step 1403). The following well-known formulas (1) and (2) are used in order to calculate the values of the coordinates. EQU Xi=cos (.theta.i-1+.DELTA..theta.).times.r (1) EQU Yi=sin (.theta.i-1+.DELTA..theta.).times.r (2)
Here, in the above formulas (1) and (2), the following expressions are substituted; .DELTA..theta.=2.pi./N, .theta.i-1=.DELTA..theta..times.(I-2) (i=2, . . . , N)
The sign reversing unit 113 computes the respective coordinate values in the second, third and fourth quadrants by reversing sign of the coordinate values computed by the coordinate value computing unit 112, with respect to one of an X-coordinate and a Y-coordinate and with respect to the both coordinates (Step 1404).
While, when the number of angles N is odd, the coordinate value computing unit 112 computes the coordinate values of vertices existing in the first and fourth quadrants, as indicated in FIG. 15(B) (Step 1405). The sign reversing unit 113 computes the coordinate values of the vertices in the second and third quadrants by reversing the sign of the computed coordinate values (Step 1406).
Finally, adding the coordinate values (x, y) of the center of a circumscribed center to the coordinate values of each vertex computed through the above steps, makes the polygon in a position to permit parallel translation to the original position, which serves as the output from the data output unit 114 (Step 1407).
This time, a graphic arrangement device according to the second example of the conventional arts, disclosed in Japanese Patent No. 63-24460 "A Graphic Processor Having a Function of Creating a Regular Polygon" will be described. The graphic arrangement device disclosed in the same is used in order to arrange a polygon of any shape into a regular polygon.
FIG. 16 is a block diagram showing a constitution of the graphic arrangement device disclosed in the same. Referring to FIG. 16, the graphic arrangement device according to the second conventional art comprises a control processor 240, a memory 212, a keyboard 222, a coordinate position appointing means (mouse) 224, an input interface 230, a display monitor 232, a bitmap memory 234, a display processor 236 and an internal bus 238. The memory 212 comprises a program unit 214, a document buffer 216 and a working area 218.
FIG. 17 is a flow chart for use of describing a flow of processing in the graphic arrangement device according to the second conventional art. FIG. 18 is a view for use of describing an operation of the graphic arrangement device according to the second conventional art when an input graphic is a triangle. An operation of the graphic arrangement device will be, hereinafter, described with reference to FIGS. 16 to 18. For the sake of explanation, assume that a graphic has been entered at the time of starting processing.
The control processor 240 takes out the data on the appointed polygon from the document buffer 216 of the memory 212, and stores it into the working area 218 (Step 1701). Next, the control processor 240 takes out the both coordinates data of a first vertex P1! and the next vertex P2! from the data on the appointed graphic stored in the working area 218, and computes the length of a segment connecting P1! and P2! as the length of one side "edge" of a regular polygon to be processed (hereinafter, referred to as an "objective regular polygon"). As indicated in FIG. 16, the control processor 240 computes the angle "base" formed by the segment connecting the vertices P1! and P2! and a prescribed coordinate axis, for example, an X-axis (Step 1702). The vertex number i in the vertex Pi! of the objective regular polygon, which is the vertex to be sought newly, is initialized to 3 (Step 1703).
Next, the control processor 240 judges whether the value shown by the vertex number i is the vertex number n or below of the normalization objective polygon (Step 1704). When the vertex number i is n or below, the processor 240 computes the angle "step" formed by the segment connecting the vertex Pi-1! and the vertex Pi! of the objective regular polygon, or the side of the order i-1 of the objective regular polygon, and an X-axis by the following formula (3) (Step 1705). EQU Step=((360.degree..times.(i-2))/n)+base (3)
The control processor 240 shifts the vertex Pi-1! in the positive direction of the X-axis by the distance indicated by the side length "edge" obtained in Step 1702, so as to obtain a provisional vertex Pi!' (Steps 1706 and 1707).
The control processor 240 rotates the provisional vertex Pi!' by the angle "step" with Pi-1! fixed as a center, so that the vertex obtained after the rotation is fixed as Pi! (Step 1708). After the completion of Step 1708, the control processor 240 modifies the vertex number i by an increment of 1 (Step 1709), thereby to return to the judgment in Step 1704.
The process from Step 1705 to Step 1709 is repeated until when the vertex number i becomes more than the number of the vertices n in Step 1704. When the vertex number i becomes more than the number of the vertices n, the processing is stopped here and the arranged graphic is displayed (Step 1704).
This time, a graphic arrangement device according to the third example of the conventional arts disclosed in Japanese Patent Laid-Open No. 63-261481, "A Method of Recognizing Symmetry of Graphics in a Graphic Recognizing Device" will be described. The graphic arrangement device disclosed in the same is used in order to recognize a figure drawn by the mnemonic operation method and make up for the measurements not illustrated in the figure.
FIG. 19 is a block diagram showing a constitution of the graphic arrangement device disclosed in the same. Referring to FIG. 19, the graphic arrangement device according to the third example of the conventional arts comprises a graphic recognizing device 301, a proposed symmetry segment extracting unit 302, a vertical segment setting unit 303, an arithmetic unit 304, and a graphic information setting unit 305. The graphic recognizing device 301 comprises a readout processing unit 311, an image data storing unit 312, a vector processing unit 313, a vector sorting processing unit 314, a symbol recognition processing unit 315, a segment discrimination processing unit 316, a character recognition processing unit 317 and a recognition result storing unit 318.
FIG. 20 is a flow chart for use of describing a flow of processing in the graphic arrangement device according to the third example of the conventional arts. FIG. 21 is a view for use of describing a symmetry judging method of a shape line intersecting a center line in the graphic arrangement device according to the third example of the conventional arts. An operation of the graphic arrangement device will be, hereinafter, described with reference to FIGS. 19 to 21.
The graphic recognizing device 301 is initially arranged to perform the following processing. That is, a drawing 300 entered into the readout processing unit 311 is stored into the image data storing unit 312. The vector processing unit 313 performs a polygonal line approximation on the image data stored in the image data storing unit 312, converts it into vector data, and delivers the data to the vector sorting processing unit 314. The vector sorting processing unit 314 supplies the vector data sorted into one of symbol, character and segment, to the symbol recognition processing unit 315, the segment discrimination processing unit 316 and the character recognition processing unit 317 respectively. The segment discrimination processing unit 316 classifies the vector data showing the segments into a shape line, a center line and the like, to store the result into the recognition result storing unit 318. The symbol recognition processing unit 315 and the character recognition processing unit 317 recognize symbols and characters respectively, so to store the data into the recognition result storing unit 318 with attributes attached thereto according to the result.
The proposed symmetry segment extracting unit 302 loads the data stored in the recognition result storing unit 318 (Step 2001), extracts the data on center lines having possibility of serving as symmetry axes, from the recognition result storing unit 318, so to compute the number of the center lines (Step 2002). As for each of the extracted center lines, the unit 302 checks whether there are any shape lines intersecting the center line, or any shape lines isolated from the center line at top and bottom or left and right of the center line (Step 2003).
At this time, when there is a center line intersecting a shape line, or an isolated shape line at the both sides of a center line, the vertical segment setting unit 303 and the arithmetic unit 304 are used in order to recognize the shape line or the symmetry of the isolated state of the shape line (Steps 2004 and 2005).
A judging method of symmetric condition in the graphic arrangement device according to the third example of the conventional arts will be explained with reference to FIG. 21.
The vertical segment setting unit 303 draws a perpendicular L2, for example, from an endpoint P2 of a vector to the center line b. The arithmetic unit 304 requires the distance l.sub.2 from the endpoint P2 to the center line b, and further requires the distance m.sub.2 from the intersection X2 on the vector c to the center line b. The intersection X2 is a point where the extended perpendicular L2 comes across the vector c. The difference between the distance l.sub.2 and m.sub.2 is calculated, so to check whether the relation between the difference and a constant threshold level (.DELTA.1/2) satisfies the following formula (4). When the formula (4) is satisfied, similar calculation will be performed with respect to the other endpoints. EQU .vertline.l.sub.2 -m.sub.2 .vertline.&lt;.DELTA.1/2 (4)
When the formula (4) is satisfied with respect to all the endpoints, and the relation between the total value of difference of each distance and the constant threshold level Q satisfies the following formula (5), the shape lines are judged to be symmetric with respect to the center line b. EQU .SIGMA..vertline.1.sub.n -m.sub.n .vertline.&lt;Q (5)
After the completion of symmetric judgment as for all the center lines, the graphic information setting unit 305 sets up the omitted graphic information on the basis of a part of the graphic information imparted to the symmetrical shape lines (Step 2007).
The above conventional graphic arrangement devices, however, have the following problems.
As a first problem, the graphic arrangement device according to the first example of the conventional arts is capable of creating nothing but a regular polygon. This is why this device cannot be applied to anything but a special figure like a regular polygon, because their input graphic parameters are the number of vertices and a radius of a circumscribed center.
As a second problem, the graphic arrangement device according to the first example of the conventional arts cannot create a regular polygon inclined to a reference (X-axis, Y-axis) determined externally. This is why the coordinates of each vertex are found by the use of an X-axis and a Y-axis as a reference, and the first vertex is located on the X-axis and Y-axis.
As a third problem, the graphic arrangement device according to the second example of the conventional arts transforms the figures such as a concave polygon and a polygon whose sides intersect together, into a regular polygon. This is why the device adopts an algorithm of making the polygons of any shape into a regular polygon.
As a fourth problem, the graphic arrangement device according to the third example of the conventional arts cannot arrange graphics in line symmetrical figures practically. This is why this device is originally used in order to judge the symmetric characteristic and make up for the measurement information. It does not aim to transform the shape of entered graphics.
As a fifth problem, the graphic arrangement device according to the third example of the conventional arts requires users to draw a graphic in consideration of a symmetry axis. This is why, of various kinds of lines, some kinds of lines are fixed as a center line and only the prescribed center lines are regarded as the symmetry axes.